<template>
	<!-- 弹出可输入文字的对话框 -->
	<view id="bohui" v-show="isShow">
		<view id="confrimBox">
			<view class="header">
				<text>{{title}}</text>
			</view>
			<view class="content">
				<input type="number" v-model="pirntNum" placeholder="请输入打印数量" />
				<!-- <textarea :placeholder="placeholder" v-model="value" /> -->
			</view>
			<view class="footer">
				<view @click="hide" class="cancel rightBorder">取消</view>
				<view @click="define" class="enter">确定</view>
			</view>
		</view>
	</view>
</template>

<script>
	// 
	export default {
		props: {
			isShow: {
				type: Boolean,
				default () {
					return false
				}
			},
			title: {
				type: String,
				default () {
					return "请输入"
				}
			},
			placeholder: {
				type: String,
				default () {
					return "请输入..."
				}
			}
		},
		data() {
			return {
				pirntNum: "1"
			};
		},
		methods: {
			hide() {
				this.$emit('cancelModal')
			},
			define() {
				this.hide()
				console.log(this.pirntNum);
				this.$emit('okModal', this.pirntNum);
			}
		}
	}
</script>

<style lang="scss" scoped>
	#bohui {
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		height: 100vh;
		background-color: rgba(0, 0, 0, .5);
		display: flex;
		align-items: center;
		justify-content: space-around;
	}

	#confrimBox {
		width: 85%;
		border-radius: 20rpx;
		background-color: #FFFFFF;
		overflow: hidden;
		margin-top: -10vh;

		.header {
			display: block;
			text-align: center;
			font-size: 32rpx;
			padding: 20rpx;
			border-bottom: 1rpx solid #f5f5f5;

			text {
				text-align: center;
				font-size: 32rpx;
			}
		}

		.content {
			padding: 20rpx 30rpx 30rpx;

			uni-textarea {
				width: 100%;
				height: 120rpx;
				padding: 4rpx;
				font-size: 28rpx;
			}
		}

		.footer {
			display: flex;
			align-items: center;
			flex-wrap: nowrap;
			justify-content: space-between;
			border-top: 2rpx solid #f5f5f5;

			view {
				width: 50%;
				text-align: center;
				padding: 20rpx;
				font-size: 32rpx;
			}

			view:active {
				background-color: rgba($color: $uni-bg-color-grey, $alpha: 1);
			}

			.rightBorder {
				position: relative;
			}

			.rightBorder:after {
				content: "";
				width: 2rpx;
				height: 100%;
				background-color: $uni-bg-color-grey;
				position: absolute;
				top: 0;
				right: 0;
			}

			.cancel {
				color: $uni-text-color-grey;
			}

			.enter {
				color: $uni-color-primary;
			}
		}
	}
</style>
